package ru.averta.notes.dao;

import java.io.Serializable;
import java.util.List;

/**
 * The basic GenericDao interface with CRUD methods
 * Finders are added with interface inheritance and AOP introductions for concrete implementations
 *
 * Extended interfaces may declare methods starting with find... list... iterate... or scroll...
 * They will execute a preconfigured query that is looked up based on the rest of the method name
 */
public interface GenericDao<T, PK extends Serializable>
{

    PK create(T newInstance);

    T findByID(PK id);

    void save(T transientObject);

    void remove(T persistentObject);
    
    void remove(PK id);
    
    List<T> findAll();
    
    List<T> findAllByProperty(String propertyName,Object value);
    
}
